Prizm Content Connect
Work Files

POST /WorkFile{?FileExtension}{&MinSecondsAvailable}

Creates a new WorkFile.

A WorkFile can be any file, including a PDF document, XML document or PNG image. The purpose of a WorkFile is for temporary storage of files so they can be shared by various PCC Services that need to act on it. A WorkFile can be a file you provide as input to a process or a file provided to you as output from a process.

A WorkFile should not be used for archival storage. By default, WorkFile objects will be automatically deleted 24 hours after they are created.

Http Method

POST

Parameters

Name Description Details

FileExtension

This is the file extension of the file to be added as a WorkFile. This parameter may or may not be required depending on the file type and whether Format Detection is enabled. Note that the extension must not include the leading period (for example, 'jpg' is accepted but '.jpg' will return a 400 HTTP status). Extensions are not case sensitive. If Format Detection is disabled, the FileExtension must be provided. 

If Format Detection is enabled (default), the use of the FileExtension is as follows:

  • If the file is uniquely identified by the Format Detection process and no FileExtension is provided, the detected FileExtension will be used.
  • If the file is uniquely identified by the Format Detection process and a FileExtension is provided but differs from the detected FileExtension, the detected FileExtension will be used.
  • If the file is ambiguously identified by the Format Detection process (one of several text types) and a FileExtension is provided, the provided FileExtension will be used.
  • If the file is ambiguously identified by the Format Detection process (one of several text types) and no FileExtension is provided, an error code of 'AmbiguousFileFormatRequiresFileExtension' will be returned with a 580 HTTP status.
  • If the file is not identified by the Format Detection process and a FileExtension is provided, the provided FileExtension will be used.
  • If the file is not identified by the Format Detection process and no FileExtension is provided, an error code of 'UnrecognizedFileFormat' will be returned with a HTTP 580 status.

string, required

Example: pdf

MinSecondsAvailable

The minimum number of seconds which this WorkFile must remain available. If not provided, a configurable default value is used. This value is ignored if it is shorter than the configurable value.

integer, optional

Example: 60

Request Body

The binary file data.

Response Body

If successful, this method returns JSON containing the following properties:

Name Description Details

fileId

The ID of the newly created WorkFile. This ID can be used in other requests that accept a WorkFile ID as input.

string, required

Example: CVBuD7DbQYNoJDqByGierQ

fileExtension

If Format Detection is disabled, this is the FileExtension provided in the request.

If Format Detection is enabled (default), this may be the FileExtension provided in the request or it may be replaced with another value depending upon the results of the Format Detection process:

  • If the file is uniquely identified by the Format Detection process, this is the extension returned by that process.
  • If the file is ambiguously identified by the File Detection process and a FileExtension was provided in the request, then this is the FileExtension provided.
  • If the file is ambiguously identified by the File Detection process and no FileExtension was provided in the request, then an error code of 'AmbiguousFileFormatRequiresFileExtension' will be returned with a 580 HTTP status.
  • If the file is not identified by the Format Detection process and a FileExtension is provided, the provided FileExtension will be used.
  • If the file is not identified by the Format Detection process and no FileExtension is provided, an error code of 'UnrecognizedFileFormat' will be returned with a HTTP 580 status.

Status Codes

Examples

Example Request
Copy Code
POST http://localhost:18681/PCCIS/V1/WorkFile?FileExtension=pdf
Content-Type: application/octet-stream
[binary file data]

 

Example Response
Copy Code
200 OK
Content-Type: application/json
{
    "fileId": workFileId
}

GET /WorkFile/{WorkFileId}{?ContentDispositionFilename}

Gets the data associated with an existing WorkFile.

Http Method

GET

Parameters

Name Description Details

WorkFileId

ID of the WorkFile to retrieve

string, required

Example: CVBuD7DbQYNoJDqByGierQ

ContentDispositionFilename

Name to use in the Content-Disposition response header.

The default value is "file-{WorkFileId}".

The file extension given when the WorkFile was created will automatically be added to the Content-Disposition filename.

string, optional

Example: MonthlySalesReport

Request Body

None

Response Body

The binary file data.

Status Codes

Examples

Example Request
Copy Code
GET http://localhost:18681/PCCIS/V1/WorkFile/CVBuD7DbQYNoJDqByGierQ?ContentDispositionFilename=MontlySalesReport

 

Example Response
Copy Code
200 OK
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=MonthlySalesReport.pdf
[binary file data]

 

 

 


©2015. Accusoft Corporation. All Rights Reserved.

Send Feedback